package com.hujf.netty.nio.zerocopy;

import java.io.DataInputStream;
import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;

/**
 * @author Hujf
 * @title: OldIOServer
 * @date 2021/1/26 0026下午 4:34
 * @description: TODO
 */
public class OldIOServer {

    public static void main(String[] args) throws IOException {
        ServerSocket serverSocket = new ServerSocket(7001);
        Socket socket = serverSocket.accept();
        DataInputStream inputStream = new DataInputStream( socket.getInputStream());

        byte[] bytes =new byte[4094];
        int len =0;
        while((len=inputStream.read(bytes,0,bytes.length))!=-1){
        }
        inputStream.close();
        serverSocket.close();
    }
}
